<template>
  <div class="remarks-style">
    <img
      class="close-box"
      @click="store.setChildRemarksShow(false)"
      :src="publicUrls + 'free/style15/scrollExhibits15close.webp'"
      alt=""
    />
    <div
      class="remarks-style-conetnt"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style15/scrollBcakgroundExhibits15.webp'})`,
      }"
    >
      <div class="remarks-style-left">
        <div class="title-parent">
          <div class="title-center">
            {{ store.childTitle }}
          </div>

          <div class="subTitle" :class="store.isMobileType && 'subTitleWap'" v-if="store.childSubTitle">
            ——{{ store.childSubTitle }}
          </div>
        </div>
        <scrollBox
          color="rgba(51, 51, 51, 1)"
          :scrollSrc="publicUrls + 'free/style15/pen.png'"
          v-if="Scrollheights"
          :remarks="store.childRemarks"
          :byid="100"
          :isTop="true"
          :tabbmScroll="getTabmComputed"
          :height="getScrollWComputed"
        >
          <template #solidBorder>
            <div class="solidBorder-child"></div>
          </template>
        </scrollBox>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'styleOne',
});
</script>

<script setup lang="ts">
import { getMobileType } from '@/utils/getMoble';
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../../../pages/public/copyright/scrollBox10.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';

const isMobile = ref(false);
isMobile.value = getMobileType();
const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 450;
const getScrollWComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 450;
  return heights;
});
const getTabmComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 24;
  return heights;
});
</script>   

<style scoped lang="less">
.remarks-style {
  display: flex;
  flex-direction: column;
  position: relative;
  //   width: 100%;
  //   max-width: 1200px;
  width: 1200px;
  height: 720px;
  background: transparent;

  transform: translateZ(0px);
}
.remarks-style-conetnt {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 100px;
  padding-bottom: 40px;
}

.remarks-style-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  // flex: 1;
  width: 100%;
  height: 100%;
}

.subTitle {
  color: #393836;
  text-align: left;
  font-size: 18px;
  line-height: 28px;
  font-family: SourceHanSerifCN;
  margin-top: 16px;
}
// .subTitleWap {
//   font-size: 24px !important;
//   line-height: 28px !important;
// }
.title-parent {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 34px;
}
.title-center {
  width: 100%;
  height: 51px;
  font-family: SourceHanSerifCN-Bold;
  font-size: 32px;
  font-weight: 400;
  line-height: 51px;
  text-align: left;
  color: rgba(103, 92, 77, 1);
}

.close-box {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 16px;
  right: 10px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  z-index: 30;
}
// .close-2 {
//   cursor: pointer;
//   display: flex;
//   align-items: center;
//   justify-content: center;
//   position: absolute;
//   top: 48px;
//   right: 20px;
//   width: 32px;
//   height: 32px;

//   z-index: 30;

// }

::v-deep {
  .solid-box-parent {
    width: 32px;
  }
  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 6px);
  }
}
:deep(.unit-exbi-remarks-info-remarks p) {
  font-family: PingFang SC;
  font-weight: 400;
  font-size: 16px !important;
  color: rgba(51, 51, 51, 1) !important;
  line-height: 32px !important;
  margin-bottom: 24px;
}
:deep(.solid-box-parent) {
  position: absolute;
  right: -17px;
  // margin-right: -32px;
}
:deep(.unit-exbit-null-remarks-info) {
  display: flex;
  // align-items: center;
  height: 100%;
}
.solidBorder-child {
  width: 2px;
  height: 100%;
  background: rgba(195, 183, 163, 1);
  border-radius: 1px;
  opacity: 0.6;
}
:deep(.solid-box-parent) {
  position: absolute;
  right: -64px;
}
:deep(.unit-exbi-remarks-info-remarks) {
  width: calc(100% - 1px);
}
::v-deep .templatestyle1-scroll-box-tumb {
  display: flex;
  justify-content: center;
  top: -4px;
  .scrollBar {
    width: 2px;
    // height: 100%;
    height: 24px;
    background: rgba(195, 183, 163, 1);

    border-radius: 25px;
    box-shadow: none;
  }
}
::v-deep .unit-exbi-remarks-info-remarks {
  p {
    color: rgba(57, 56, 54, 0.8);
    font-size: 17px;
    line-height: 32px;
    text-align: justify;
    font-weight: normal;
  }
}
:deep(.tumb-max) {
  left: calc(100% - 24px) !important;
}
:deep(.templatestyle1-scroll-box-tumb img) {
  width: 30px;
  height: 30px;
  margin-top: -4px;
  transform: scale(1.1);
}
</style>
